﻿//     Copyright (c) Microsoft Corporation.  All rights reserved.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.Gateway.Configuration
{
    public class TargetRoute 
    {
        public TargetRoute() { }

        public TargetRoute(string redirect) : this(redirect, null) { }

        public TargetRoute(string redirect, int? weight)
        {
            Redirect = redirect;
            Weight = weight;
        }

        public int? Weight { get; set; }
        public string Redirect { get; set; }

        [JsonIgnore]
        public bool IsDefault
        {
            get
            {
                return Weight == null;
            }
        }
    }
}
